﻿using System;

namespace diantou.web.management
{
    /// <summary>
    /// 最终榜单
    /// </summary>
    [fastCSharp.code.cSharp.webView(IsPage = false, IsPool = true)]
    partial class contestRank : adminView<contestRank>
    {
        /// <summary>
        /// 比赛
        /// </summary>
        [fastCSharp.emit.webView.clearMember]
        private diantou.dataAccess.contest contest;
        /// <summary>
        /// 
        /// </summary>
        [fastCSharp.emit.webView.clearMember]
        private web.contest.pointRank.rank[] ranks;
        /// <summary>
        /// 最终榜单
        /// </summary>
        /// <param name="contestId">比赛标识</param>
        /// <returns>是否成功</returns>
        private bool loadView(int contestId)
        {
            if ((contest = diantou.dataAccess.clientCache.Contest[contestId]) != null)
            {
                int count, index = 0;
                long judgeTicks;
                diantou.dataAccess.contestJudge.pointRankItem[] values = diantou.dataAccess.tcpCall.contestJudge.getPointRank(contestId, 10, 1, out count, out judgeTicks);
                ranks = new web.contest.pointRank.rank[values.Length];
                foreach (diantou.dataAccess.contestJudge.pointRankItem user in values)
                {
                    ranks[index].Set(user, index + 1, false);
                    ++index;
                }
                return true;
            }
            return false;
        }
    }
}
